import request from '@/utils/request'
// 注册请求
export const userRegisterService = ({ username, password, repassword }) =>
  request.post('/api/reg', { username, password, repassword })
//登录请求
export const userLoginService = ({ username, password }) =>
  request.post('/api/login', { username, password })
// 获取用户基本信息
export const userGetInfoService = () => request.get('/my/userinfo')
//修改用户基本资料
export const userUpdateInfoService = ({ id, nickname, email }) =>
  request.put('/my/userinfo', { id, nickname, email })

//修改头像
export const userUploadAvatarService = (avatar) =>
  request.patch('/my/update/avatar', { avatar })
